#include "led.h"

int Led_Work(int op){
	switch (op){
		case NON:
			break;
		case WORK_NORMAL:
			digitalWrite(6,LOW);
			delay(400);
			digitalWrite(6,HIGH);
			break;
		case AIR_NORMAL:
			digitalWrite(6,LOW);
			delay(200);
			digitalWrite(6,HIGH);
			delay(200);
			digitalWrite(6,LOW);
			delay(200);
			digitalWrite(6,HIGH);
			break;
		case AIR_WORK_END:
			digitalWrite(6,HIGH);
			break;
		default:
			DEBUG("op error");
			break;
	}
	return 0;
}

int Led_Init(){
	wiringPiSetup();
	pinMode(6,OUTPUT);
	digitalWrite(6,HIGH);
	return 0;
}

//#if LED_TEST
int main(){
	DEBUG("Led init");
	Led_Init();
	DEBUG("work type: WORK_NORMAL");
	Led_Work(WORK_NORMAL);
	sleep(1);
	DEBUG("work type: AIR_NORMAL");
	Led_Work(AIR_NORMAL);
	sleep(1);
	DEBUG("work type: AIR_WORK_END");
	Led_Work(AIR_WORK_END);
	return 0;
}
//#endif
